#pragma once
#include <Box2D/Box2D.h>
#include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Dynamics/b2World.h>
#include <Box2D/Dynamics/b2Body.h>
#include "StageParser.h"
#define ORIGEN_X 0.0
#define ORIGEN_Y 0.0
#define CHAIN_DENSITY 0.0
#define STEP 0.01

class Terreno {
public:
	Terreno(const float* alturas, float escalaX, unsigned int ancho, b2World &mundo);
	virtual ~Terreno();
	float getAlturaMaxima(){ return this->alturaMaxima; };
private:
	list<b2ChainShape> relieves;
	b2Body* terrenoBody;
	float toleranciaX;
	float toleranciaY;
	float escalaX;
	unsigned int ancho;
	void construirRelieve(const float* alturas, int primerVertice, int ultimoVertice);
	void iniciarRelieves();
	float alturaMaxima;
};
